package com.zxy.furns.utils;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;

/**
 * ClassName: WebUtils
 * Package: com.zxy.furns.utils
 *
 * @Author zxy
 * @Create 2025/3/28 22:26
 * @Version 1.0
 * title:
 * Description:
 */
public class WebUtils {
    public static String FURN_IMG_DIRECTORY = "assets/images/product-image";

    public static boolean isAjaxRequest(HttpServletRequest request) {
        String header = request.getHeader("X-Requested-With");
        return "XMLHttpRequest".equals(header);
    }
    public static String getYearMonthDay() {
        LocalDateTime localDateTime = LocalDateTime.now();
        int year = localDateTime.getYear();
        int monthValue = localDateTime.getMonthValue();
        int day = localDateTime.getDayOfMonth();
        return "/"+year + "/" + monthValue + "/" + day;
    }
}
